package com.twu.biblioteca;

import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * User: ialbuqu
 * Date: 7/1/13
 * Time: 1:54 PM
 * To change this template use File | Settings | File Templates.
 */

public class IOHandler implements Interface{
    private PrintStream output;
    private InputStream input;
    private Scanner scanner;

    public IOHandler() {
        this.input = System.in;
        this.output = System.out;
    }

    public IOHandler(PrintStream printStream, InputStream inputStream) {
        this.input = inputStream;
        this.output = printStream;
    }



    @Override
    public String getInput() {
        scanner = new Scanner(this.input);
        return scanner.nextLine();
    }


    @Override
    public void printMessage(String message) {
        output.print(message);
    }

}
